<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>一点知识系统</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3"/>
<meta http-equiv="description" content="this is my page"/>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<script type="text/javascript" src="../../head.js"></script>
</head>
	<body>
		<form id="my-form">
			<div id="tools" class="datagrid-toolbar">
				<a onclick="save();" class="easyui-linkbutton" iconCls="icon-save" plain="true">保存</a>
				<a onclick="window.location.reload();" class="easyui-linkbutton" iconCls="icon-reload2" plain="true">刷新</a>
				<a onclick="closeWindow();" class="easyui-linkbutton" iconCls="icon-close" plain="true">关闭</a>
		    </div>
			<p id="errorMsg" style="color:red;margin-top:5px;"></p>
			<table class="formTable" >
				<tr>
					<td class="tdc1">
						课时名称：
					</td>
					<td align="left">
						<input type="text" name="subclasstimename" id="subclasstimename" class="easyui-validatebox" data-options="required:true" maxlength="100" />
					</td>
					
					<!-- <td align="right" class="coursewarename">课件类型：</td>
					<td align="left"  class="coursewarename">
						<select id="coursewarename" name="typeid">说明：下拉和id没有关系只和name有关，会吧选择的列表的某一个id给name进行获取和赋值
							<option value="-1">--请选择--</option>
						</select>
					</td> -->
				</tr>
				<tr>
				<td class="tdc1">
					课时时长：
				</td>
				<td>
					<input type="text" name="subclasstimenum" data-options="required:true" class="easyui-validatebox" />
				</td>
			   </tr>
			   <tr>
				<td class="tdc1">
					课程链接：
				</td>
				<td>
					<input type="text" name="subclassurl" data-options="required:true" class="easyui-validatebox" />
				</td>
			   </tr>
			   <tr>
				<td class="tdc1">
					备注：
				</td>
				<td>
					<textarea id="remark" name="remark"></textarea>
				</td>
			   </tr>
			</table>
		</form>
	</body>
</html>
<script>
	function checkFormMe(form){
		return $('#my-form').form('validate');
	}

	window.onload = function(){
		for(i=0;i<=228;i++){
			var icon = "<div onclick=\"checkIcon('icons"+i+"');\" class='icons"+i+"' style='border:1px solid #E0ECFF;width:18px;height:19px;float: left;margin-bottom: 3px;margin-left: 3px;cursor: pointer;'></div>";
			$('#checkIcon').append(icon);
		}
	}
	function checkIcon(ico){
		$('#icon').removeClass();
		$('#icon').addClass(ico);
		$('#img').val(ico);
		$('#checkIcons').dialog('close')
	}
	
	/* selectType();
	//选择知识课件
	function selectType(){
		$("#coursewarename").empty();
		$.post(contextPath+"/system/queryAllCourseWareBytype",
		  {'dataCode':"coursewarename",'depth':2},function(data){
		     $("#coursewarename").append("<option value='-1'>--请选择--</option>");
		     if(data!=null && data.length>0){
		    	 for(var i=0;i<data.length;i++){
		    		 $("#coursewarename").append("<option value='"+data[i]['id']+"'>"+data[i]['coursewarename']+"</option>"); 
		    	 }
		     }
		 });
	} */
	
	var id = getPram('id');
	$('#parentId').val(id);
	function save(){
		if(checkFormMe()){
			var arg = $('#my-form').serializeArray();
			jQuery.post(contextPath+"/system/addSubclassTime?id="+id,arg,
			function (data) {
				var res =$.parseJSON(data.toString());
				if(res['flag'] == "success"){
					$.messager.alert("提示","操作成功!",'info',function(rt){
						window.parent.query();
						closeWindow();
					});
				}else{
					$.messager.alert("提示","操作失败!",'error');
				}
			});
		}
	}
</script>